<template>
  <h1>使用pinia </h1>

  <button @click="add1">+1</button>{{  add}}
  <hr />
  <button @click="sub1">-1</button>{{ reduce }}

</template>

<script setup>
import { reactive, ref } from "vue";

import { useStore } from '../../js/pinia'
import { storeToRefs } from 'pinia'

const store = useStore()
const { add, reduce } = storeToRefs(store)

let num = ref(0);
let num2 = ref(100);

function add1() {
  store.increase();
}

function sub1() {
  store.decrease();
}
</script>

<style>
</style>